package org.myorg.v5;

public class E1 {
	public static void main(String[] arg) {
		System.out.println("enter main");

		Fmap fc = new Fmap();

		FPeople5 my_p = NSGA.nsga(fc.getM(), 48, 0.9, 1d/fc.getM(), 1000, fc.getN(),fc);
		
		my_p.print();
		FGene5 cpu = my_p.persons[0],mem = my_p.persons[0],bro = my_p.persons[0],mean = my_p.persons[0];
		
		for (int i=1; i<my_p.p_num; i++) {
			if (my_p.persons[i].goals[0] < cpu.goals[0]) {
				cpu = my_p.persons[i];
			}
			if (my_p.persons[i].goals[1] < mem.goals[1]) {
				mem = my_p.persons[i];
			}
			if (my_p.persons[i].goals[2] < bro.goals[2]) {
				bro = my_p.persons[i];
			}
			double a = my_p.persons[i].goals[0] +  my_p.persons[i].goals[1] + my_p.persons[i].goals[2];
			double b =  mean.goals[0] +   mean.goals[1] +  mean.goals[2];
			if ( a < b) {
				mean = my_p.persons[i];
			}
		}
		
		System.out.println("cpu: ");
		cpu.print();
		
		System.out.println("mem: ");
		mem.print();
		
		System.out.println("bro: ");
		bro.print();
		
		System.out.println("mean: ");
		mean.print();
		
		FGene5 g = Random.rand(fc);
		System.out.println("random: ");
		g.print();
	
		
		//static
		g = StaticAssign.sta(fc);
		System.out.println("static: ");
		g.print();
		
		//rank match
		g = Rank.rank(fc);
		System.out.println("rank: ");
		g.print();
		
		System.out.println("leave main");
	}
}
